import os

path=os.path.dirname(__file__)
dirs=os.listdir(path)
for dir in dirs:
    testdir=os.path.join(path,dir,"testdata")
    if os.path.isdir(testdir):
        configpath=os.path.join(testdir,"config.yaml")
        if not os.path.exists(configpath):
            with open(configpath,"w",encoding="utf-8") as f:
                string="""type: default
time: 1s
memory: 256MB"""
                f.write(string)
            print("add config.yaml to ",testdir)
        else:
            print("config.yaml already exists in ",testdir)
